<?php

namespace App\Admin;

use Illuminate\Database\Eloquent\Model;


class Tw extends Model
{
    protected $table='two';//绑定表
    public $timestamps=false;//一定要关闭时间戳,这里不关闭,会出现update_at,字段影响入库
 //增
    static public function add($arr){
        return self::insert($arr);
    }
    //展示
    static public function list(){
        return self::paginate(3); //或者get可以
    }
    //搜索
    static public function search($keyword){
        return self::where('title','like','%'.$keyword.'%')->paginate(3);
    }
    //编辑
    static public function edit($id){
        return self::where('id',$id)->find($id);
    }
    //修改
    static public function upda($id,$arr){
        return self::where('id','=',$id)->update($arr);
    }
}
